import React from "react";
import { useSelector } from "react-redux"
import ListItem from '../../components/listItem'
import { useNavigate } from "react-router-dom";
import { NavBar } from "react-vant";
const Index = () => {
  const collectionList = useSelector(state => state.userReducer.collectionList)
  const navigate = useNavigate()
  return <div>
    <NavBar onClickLeft={() => navigate(-1)} title='我的收藏'></NavBar>
    {
      collectionList.map((v, i) => {
        return <ListItem key={i} v={v} onClick={() => navigate('/detail/' + v.id)}></ListItem>
      })
    }
  </div>;
};

export default Index;
